<?php
namespace app\worker\service;

use app\common\helper\FormatHelper;
use think\Db;
use app\web\controller\UserFace;
class FaceService {



    /**
     * 获取用户人脸识别信息和会员卡
     */
    public static function getUserFace($storeId){

        $data = Db::name('qt_user_face_detect')->where(['store_id'=>$storeId,'status'=>'0'])->select();
        $resultData = [];
        foreach ($data as $key=>$value){
            $faceCon = UserFace::search($value['picture_url']);
            Db::name('qt_user_face_detect')->where('id', $value['id'])->update(['status'=>1,'result_data'=>$faceCon['msg']]);
            $resultData[$key] = $faceCon['data'];
        }

        return FormatHelper::fReturn('查询成功',$resultData);
    }




}
